package com.sinochem.yunlian.ship.common.exception;

import com.sinochem.yunlian.ship.common.enums.ResponseCode;

/**
 * Created by ship-admin on 2017/9/8.
 */
public class BaseException extends RuntimeException {
    private int status = 1000;

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public BaseException() {
    }

    public BaseException(String message,int status) {
        super(message);
        this.status = status;
    }

    public BaseException(String message) {
        super(message);
    }

    public BaseException(String message, Throwable cause) {
        super(message, cause);
    }

    public BaseException(Throwable cause) {
        super(cause);
    }

    public BaseException(ResponseCode responseCode) {
        super(responseCode.getName());
        this.status = responseCode.getCode();
    }

    public BaseException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }
    
    public static BaseException message(String msg) {
		
		return new BaseException(msg,ResponseCode.NOTIFICATION.getCode());
		
	}
    
	public static BaseException message(String msg, int code) {
		
		return new BaseException(msg,code);
		
	}
}
